From cf12fd0de52bdecc9734991bab6c449970fdae3c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 3 Jul 2007 18:22:22 +0000 Subject: [PATCH] Always set an error when returning NULL. (453365, Michael Chudobiak) 2007-07-03 Matthias Clasen * io-tiff.c (tiff_image_parse): Always set an error when returning NULL. (453365, Michael Chudobiak) svn path=/trunk/; revision=18365 --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/io-tiff.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 66f0d40da8..10bec09fc0 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2007-07-03 Matthias Clasen + + * io-tiff.c (tiff_image_parse): Always set an error + when returning NULL. (453365, Michael Chudobiak) + 2007-07-03 Matthias Clasen * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Be diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c index a9863e6cff..9e521022dc 100644 --- a/gdk-pixbuf/io-tiff.c +++ b/gdk-pixbuf/io-tiff.c @@ -199,8 +199,13 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error) gint h = height; (* context->size_func) (&w, &h, context->user_data); - if (w == 0 || h == 0) + if (w == 0 || h == 0) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_CORRUPT_IMAGE, + _("Width or height of TIFF image is zero")); return NULL; + } } pixels = g_try_malloc (bytes); -- 2.30.2